Carbon


GetThemeMenuItemExtra

Header: Appearance.h Carbon status: Supported

Obtains a measurement of the space surrounding a menu item.

OSStatus GetThemeMenuItemExtra (
    ThemeMenuItemType inItemType, 
    SInt16 *outHeight, 
    SInt16 *outWidth
);
inItemType

A value of type ThemeMenuItemType. Pass a constant identifying the type of menu item for which you are interested in getting a measurement. See “Theme Menu Item Type Constants”.

outHeight

A pointer to a signed 16-bit integer. On return, the integer value represents the total amount of padding between the content of the menu item and the top and bottom of its frame (in pixels). Your content’s height plus the measurement provided by the outHeight parameter equals the total item height.

outWidth

A pointer to a signed 16-bit integer. On return, the integer value represents the total amount of padding between the content of the menu item and the left and right limits of the menu (in pixels). Your content’s width plus the measurement provided by the outWidth parameter equals the total item width.

function result

A result code.

DISCUSSION

Your application should call the GetThemeMenuItemExtra function when you are writing your own menu definition function and wish to be theme-compliant. Once you have determined the height and width of the content of a menu item, call GetThemeMenuItemExtra to get a measurement in pixels of the space surrounding a menu item, including any necessary inter-item spacing, in the current theme. By combining the values for your menu item’s content and the extra padding needed by the theme, you can derive the size of the rectangle needed to encompass both the content and the theme element together.

VERSION NOTES

This function is available with Appearance Manager 1.0.1 and later.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)